home *** CD-ROM | disk | FTP | other *** search
/ Hyper Stacks 1994 May / Hyper Stacks (Pacific HiTech)(1994)[Mac].iso / Utilities / Pictoids 1.2 Update / Pictoid Demo ƒ / Pictoid.h next >
Encoding:
C/C++ Source or Header  |  1992-02-08  |  2.1 KB  |  80 lines  |  [TEXT/KAHL]

  1. /* Pictoid WDEF
  2.  
  3.    © 1990, 1991, 1992 by Nigel Perry
  4.    
  5.    This WDEF makes a window from a picture, which must be passed as a
  6.    PicHandle as the refCon parameter to the NewWindow() call. By default
  7.    the window will be the same shape as the picture, and may consist
  8.    of a number on non-contiguous areas - a mask is created
  9.    from the picture by "lasso"ing it. A variation code allows a user
  10.    supplied mask - in which case the window may have holes in it…
  11.    
  12.    This WDEF requires the BitMapToRegion trap. This currently only
  13.    exists in 32CQD systems, a version of it is included in this package
  14.    for those of you without colour.
  15.    
  16.    Dr Nigel Perry
  17.    Department of Computer Science
  18.    Massey University
  19.    Palmerston North
  20.    New Zealand
  21.    
  22.    N.Perry@massey.ac.nz
  23.  */
  24.  
  25. #ifndef _PICTOID
  26. #define _PICTOID
  27.  
  28. #define PictWDEF (16 * 16)
  29.  
  30. /* variation codes - or together with PictWDEF */
  31. /* primary */
  32. #define PW_Lasso 4
  33. #define PW_Mask 0
  34. #define PW_PicMask 8
  35. #define PW_PicWind 12
  36. /* secondary */
  37. #define PW_SizeWind 2
  38. #define PW_AddFrame 1
  39.  
  40. /* for low-level hackers… */
  41. #define PW_UserMask    8
  42. #define PW_CalcMask 4
  43.  
  44. /* allocated by WDEF Globals.c and kept by Gestalt() */
  45. typedef struct
  46. {    PicHandle    pic, frame;
  47.     struct
  48.     {    Boolean        clonePic:1;        /* T => clone pic and dispose on close
  49.                                        F => copy handle, dispose as per sharePic */
  50.         Boolean        sharePic:1;        /* T => don't dispose on close
  51.                                        F => DetachResource() on open,
  52.                                             dispose on close */
  53.         Boolean        cloneFrame:1;
  54.         Boolean        shareFrame:1;
  55.         Boolean        spare:4;
  56.     }            flags;
  57.     char        spare1;
  58.     int            spare2;
  59.     /* following fields used by Pictoid XCMD - DO NOT TOUCH */
  60.     long        private[3];
  61.     short    private2;
  62. }    WDEFGlobals, *WDEFGlobalsPtr, **WDEFGlobalsHand;
  63.  
  64. OSErr GetWDEFGlobals(Boolean, WDEFGlobals **);
  65.  
  66. /* allocated by WDEF, first three fields private to WDEF, rest set to zero */
  67. typedef struct
  68. {    PicHandle    pic, frame;
  69.     struct
  70.     {    Boolean        disposePic:1;
  71.         Boolean        disposeFrame:1;
  72.         Boolean        unused:6;
  73.         char            unused2;
  74.         int            unused3;
  75.     }            flags;
  76.     /* following fields used by Pictoid XCMD - DO NOT TOUCH */
  77.     long            private[13];
  78. }    WDEFPrivate, *WDEFPrivatePtr, **WDEFPrivateHand;
  79.  
  80. #endif